
package flc.ast.dialog;

import android.content.Context;
import android.text.TextUtils;
import android.view.Gravity;
import android.view.View;

import androidx.annotation.NonNull;
import androidx.recyclerview.widget.LinearLayoutManager;

import com.blankj.utilcode.util.ToastUtils;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.listener.OnItemChildClickListener;
import com.hpplay.sdk.source.api.IConnectListener;
import com.hpplay.sdk.source.browse.api.IBrowseListener;
import com.hpplay.sdk.source.browse.api.LelinkServiceInfo;
import com.stark.cast.screen.CastScreenManager;

import java.util.List;

import flc.ast.AppConfig;
import flc.ast.R;
import flc.ast.adapter.DeviceAdapter;
import flc.ast.databinding.DialogScanTipBinding;
import flc.ast.utils.Content;
import stark.common.basic.base.BaseSmartDialog;

public class ScanTipDialog extends BaseSmartDialog<DialogScanTipBinding> implements View.OnClickListener {

    public int type;

    public ScanTipDialog(@NonNull Context context) {
        super(context);
    }

    @Override
    protected boolean canceledOnTouchOutside() {
        return true;
    }

    @Override
    protected int getGravity() {
        return Gravity.CENTER;
    }

    @Override
    protected int getLayoutId() {
        return R.layout.dialog_scan_tip;
    }

    @Override
    protected void onStart() {
        super.onStart();

    }

    @Override
    protected void initView(View view) {
        mDataBinding.tvConfirm.setOnClickListener(this);

        if (type == 1) {
            mDataBinding.ivImg1.setImageResource(R.drawable.ahkb1);
            mDataBinding.ivImg2.setImageResource(R.drawable.ahkb2);
            mDataBinding.tvTip.setText(getContext().getString(R.string.household_register_tip));
        }else {
            mDataBinding.ivImg1.setImageResource(R.drawable.asfzz);
            mDataBinding.ivImg2.setImageResource(R.drawable.asfzf);
            mDataBinding.tvTip.setText(getContext().getString(R.string.id_card_scan_tip));
        }
    }

    @Override
    public void onClick(View v) {
        int id = v.getId();
        if (id == R.id.tvConfirm) {
            dismiss();
        }
    }

    private Ilistener listener;

    public void setListener(Ilistener listener) {
        this.listener = listener;
    }

    public interface Ilistener {
        void click();
    }
}
